import React from 'react'
import { Routes, Route } from 'react-router-dom'
import RouterGuard from './RouterGuard'
import { routes } from './routes'

const AppRouter = () => {
    return (
        <RouterGuard>
            <Routes>
                {routes.map((route) => (
                    <Route
                        key={route.path}
                        path={route.path}
                        element={<route.component />}
                    />
                ))}
            </Routes>
        </RouterGuard>
    )
}

export default AppRouter 